(1) Field of the Invention
This invention relates to a semiconductor device and a microcontroller and, in particular, to a semiconductor having prescribed terminals to receive external signals, for generating an interrupt signal based on an external signal, and a microcontroller for performing a process according to the interrupt signal.
(2) Description of the Related Art
In general, semiconductor devices generate interrupts in central processing units (CPU) according to waveforms received via external terminals. This function is realized by a dedicated external interrupt circuit and external input terminal in pairs. To flexibly match systems, a plurality of such pairs is provided.
FIG. 5 shows a construction of a conventional semiconductor device. This semiconductor device 100 is provided with external interrupt terminals 101a and 101b for receiving external interrupt signals, external interrupt circuits 1 (102a) and 2 (102b) connected to the external interrupt terminals 101a and 101b, respectively, for performing processes according to the external interrupt signals received via the terminals, and a general-purpose port input 103a for detecting the state of the external interrupt terminal 101a being connected thereto. Other than the external interrupt terminals 101a and 101b, a general-purpose input terminal 104 and a module 105 for processing a signal received from the general-purpose input terminal 104 are provided. When each external interrupt circuit 1 (102a), 2 (102b) detects change in the waveform (edge or change in level) of a signal being connected to the corresponding external interrupt terminal 101a, 101b, it outputs an interrupt signal to a CPU.
In the conventional semiconductor device 100, the connection of an external interrupt circuit and an external interrupt terminal is fixed. To cause an external interrupt, an external interrupt signal has to be connected to one of the external interrupt terminals 101a and 101b. For example, in a case of using an external signal to be entered to the module 105, as an external interrupt signal triggering an event, this signal is connected to not only the input terminal 104 but also to the external interrupt terminal 101a by using an external wire 106.
Recently, a microcomputer has been proposed, in which the connection of an external interrupt terminal and an external interrupt circuit is not fixed but the connection of an interrupt request signal output from an external interrupt terminal and an interrupt control circuit for performing an interrupt process is changeable (for example, refer to Japanese Unexamined Patent Application No. 7-105175 (Paragraphs [0016]–[0023], and FIG. 1)).